package com.server.llh.llhserverwork.utils;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.util.AttributeSet;

/**
 * EditTextLine： EditText
 * 1、普通的EditText下 画上一条线
 * Created by yangke on 2016/7/1.
 */
public class EditTextLine extends android.support.v7.widget.AppCompatEditText {

    private Paint mPaint;

    public EditTextLine(Context context, AttributeSet attrs) {
        super(context, attrs);
        mPaint = new Paint();
        mPaint.setStyle(Paint.Style.STROKE);
        mPaint.setColor(Color.rgb(235, 235, 235));
        mPaint.setStrokeWidth(3);
    }

    @Override
    public void onDraw(Canvas canvas) {
        super.onDraw(canvas);
//      画底线
        canvas.drawLine(0, this.getHeight() - 1, this.getWidth() - 1, this.getHeight() - 1, mPaint);
    }
}
